package com.physique.tea.Controller;

import com.physique.tea.Global.Result;
import com.physique.tea.Service.DeepSeekService;
import com.physique.tea.dto.CallAiRequestDto;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

@Controller
@RequestMapping("/ai")
public class AiController {

    @Autowired
    DeepSeekService deepSeekService;


    @PostMapping("/call")
    public @ResponseBody Result callAi(@RequestBody CallAiRequestDto requestDto){
        String message = "年龄："+requestDto.getAge()+",性别："+requestDto.getSex()+",需求：";
        for (String s :requestDto.getDemand()){
            message+=s;
        }
        return deepSeekService.getQuestionResult(message);

    }
}
